GH Issue 1257: Check for duplicates among field names, import aliases, and parent import aliases - #7884
GH Issue 1257: Check for duplicates among field names, import aliases, and parent import aliases#7884labkey-susanh wants to merge 6 commits into
Conversation
…, and parent import aliases
…le to all domains and tap into domain designer error messaging
| { | ||
| throw new IllegalArgumentException(String.format("An existing " + dataTypeNoun + " property conflicts with parent alias header: %1$s", trimmedKey)); | ||
| // This allows existing domains to save with conflicting aliases. Should it? | ||
| if (!existingAliases.contains(trimmedKey)) |
There was a problem hiding this comment.
@cnathe or @XingY. Do you know if this check is still valid? What is the use case where we want to allow retention of an existing alias that conflicts with a field name? Was this to protect against cases where we add (system) domain fields that conflict with already-existing import aliases? Still seems problematic to produce conflicts that we won't be able to resolve well during import.
There was a problem hiding this comment.
This check was added in #894. I guess the intention was to not break existing designer update that was already problematic. I agree in this case we should opt for rejecting ambiguity, even if the designer was not actually changed.
There was a problem hiding this comment.
Agreed. We chatted about this offline but I think we should require the admin / designer to fix the duplicates in this case on save (even if they had not touched that part of the design).
Rationale
Issue 1257: We currently permit duplicate aliases on field names in a domain as well as aliases that collide with a field name or, in the case of sample types and data classes, parent import aliases. This results in ambiguity when doing data imports so we want to prevent domains from being created in this way. This PR adds validation of the import aliases to check for overlap and for the parent import aliases to check for overlap with field import aliases. (There was already a check for overlap of parent import aliases and domain field names.)
Related Pull Requests
Changes
validateParentAliasesto check for conflicts with field import aliasesDomainUtils::validatePropertiesto check for import alias conflicts